In the related art, a structured document management device for storing and searching structured document data described in an extensible markup language (XML) or the like is known. To allow a structured document management device to search structured document data, like a query language SQL in a relational database management system (RDBMS), an XML query language (XQuery) for XML data is defined and is supported in many structured document management devices.
XQuery is a language for treating an XML dataset as a database, and means for acquiring, aggregating, and analyzing a dataset that meets certain conditions is provided. Since XML data has a layered logical structure (hierarchical structure) in which elements such as a parent, a child, or siblings are combined, conditions (structural conditions) for this hierarchical structure can be designated as conditions.
In the structural condition processing, it is necessary to perform a structure matching process of checking whether the structured document data stored in the structured document management device has a structure that meets conditions. This structure matching process can be performed at a relatively high speed if the structural condition includes a process (descendant structural condition) that designates a path from a higher layer to a lower layer. However, if the structural condition includes a process (ancestor structural condition) that designates a path from a lower layer to a higher layer, a process (sibling structural condition) that designates an antero-posterior relation on the same layer, or a process (order structural condition) that designates an order relation of elements included in XML data within the structural condition, it is difficult to perform the structure matching process at a high speed.
To solve this problem, an attempt has been made to accelerate the structure matching process by transforming the ancestor structural condition, the sibling structural condition, and the order structural condition into a combination of a join operation with the descendant structural condition. For example, a method which uses an ID called structure guide and allocated to a tag that constitutes a registration document is known. Moreover, the same can be realized by rewriting the ancestor structural condition, the sibling structural condition, and the order structural condition in XQuery as the same XQuery.
However, since the allocated ID, which is called structure guide, is required when registering a document, it is not possible to determine a structure guide in advance when processing an external resource that is not registered in the structured document management device or a structured document that is temporarily generated in the XQuery. In such a case, since it is not possible to generate an execution plan obtained by transforming the ancestor structural condition, the sibling structural condition, and the order structural condition, there is a problem in that the efficiency of the structure matching process deteriorates. Moreover, since a process of transforming XQuery in a unique format that uses the structure guide is required, there is a problem in that the configuration becomes complex.
Moreover, when structural conditions are rewritten, since it is necessary to rewrite all structural conditions that are described earlier than a target structural condition, there is a problem in that the overhead of rewriting is heavy. Moreover, since only one structured document is used as a target, if the rewritten XQuery is applied to a structured document set, the refining condition for the structured document set is not utilized, and the performance often deteriorates. Further, since XQuery needs to be applied to one document, the performance deteriorates.